package cc.linker.steplink.crm.domain;

import cc.linker.steplink.crm.commons.domain.WxUser;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 绑定用户请求实体
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class BindUserDto {
    private String openid;
    private String usercode;
    private String pwd;
    private Integer type;
    private String token;
    private String globalOpenid;
    
    public BindUserDto(WxUser wxUser){
        setWxInfo(wxUser);
    }
    
    public void setWxInfo(WxUser wxUser){
        this.openid = wxUser.getOpenid();
        this.token = wxUser.getToken();
        this.globalOpenid = wxUser.getGlobalOpenid();
    }
}
